package DisruptorTest;

import com.lmax.disruptor.RingBuffer;

/**
 * 生产者
 * */
public class MessageEventProducerWithTranslator {
    private final RingBuffer<MessageEvent> ringBuffer;

    public MessageEventProducerWithTranslator(RingBuffer<MessageEvent> ringBuffer) {
        this.ringBuffer = ringBuffer;
    }


    public void onData(String message) {
        ringBuffer.publishEvent(new MessageEventTranslator(), message);
    }
}